<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>user profile</title>
        <style>@import url("../resources/css/homepageCSS1.css")</style>
    </h:head>
    <h:body>
        <p:layout fullPage="true">
            <p:layoutUnit styleClass="topLayout" position="north" size="100" resizable="true">
                <img id="titleImg" src="../resources/images/titolo90.png" alt="METEOCAL"/>
                <div id="userBlock">
                    <h:form>
                        <p:outputLabel>
                            #{userBean.name}&nbsp;&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;&nbsp;
                        </p:outputLabel>
                        <p:link style="color: blue;" value="Home" outcome="home?faces-redirect=true"/>
                        <p:outputLabel>
                            &nbsp;&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;&nbsp;
                        </p:outputLabel>
                        <p:commandLink style="color: blue;" action="#{loginBean.logout()}" value="Logout"/>
                    </h:form>
                </div>
            </p:layoutUnit>
            <p:layoutUnit styleClass="centralBlock" position="center">
                <div styleClass="textBlock" id="visBlock" align="justify">
                    A public calendar is visible to all the users of the system. When you search for a user you're able to see 
                    all its events if he publishes his calendar but you will not be able to see his private events' details.
                    <br/>
                    <br/>
                    A private calendar is not visible to any user of the system. Even a public event in a private calendar is 
                    made invisible in that calendar. For sure, it will be accessible through another user participating in that event, if he has a public calendar.
                </div>

                <div id ="profileBlock" align="center">
                    <p:outputLabel id="visibLable"> Your calendar is #{userBean.visibility}</p:outputLabel>
                    <br/>
                    <br/>                    
                    <h:form>
                        <p:growl id="growlVis" autoUpdate="true"/>
                        <p:commandButton style="width: 60px; height: 60px; background: #000000 url(../resources/images/change_icon.png) no-repeat top right" id="chngBtn" update="growlVis" value="">
                            <f:ajax listener="#{userBean.changeVisibility()}" render="visibLable"/>
                        </p:commandButton>
                    </h:form>      
                </div>
            </p:layoutUnit>
        </p:layout>
    </h:body>
</html>

